package com.juyu.miliao.api.util;

import java.util.ArrayList;
import java.util.List;

import com.juyu.miliao.api.domain.BillDetail;

/**
 * list分页工具类
 * @author Administrator
 *
 */
public class ListPageUtil {
	
	public static List<BillDetail> getListPage(List<BillDetail> list,int page,int pageSize){
		List<BillDetail> listPage = new ArrayList<BillDetail>();
        int currIdx = (page > 1 ? (page -1) * pageSize : 0);
        for (int i = 0; i < pageSize && i < list.size() - currIdx; i++) {
        	listPage.add(list.get(currIdx + i));
        }
		return listPage;
	}
}
